package com.w3cjava.modules.user.controller;

import com.w3cjava.modules.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class UserViewController {
    @Autowired
    private UserService userService;
    /**
     * 查询所有数据 freemarker
     * @param model
     * @return
     */

    @GetMapping("/list")
    public String list(Model model){
        model.addAttribute("userList", userService.findAll());
        return "user";
    }
}
